/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: xiaotutu
 * Date: 2023-10-24
 * Time: 19:16
 */
class Student {


    private int age;

    public static String classRoom = "301";

    public Student() {
        System.out.println("调用不带参数的构造方法!");
    }

    {
        this.name = "zhang san";
        System.out.println("构造块!");
    }

    private String name = "88888";

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
        System.out.println("调用带两个参数的构造方法!");
    }

    static {
        classRoom = "201";
        System.out.println("静态块!");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}

public class Test {
    public static void main(String[] args) {
        System.out.println(Student.classRoom);
        Student student = new Student();
        System.out.println(student.getName());
    }
}
